
from datetime import datetime
from typing import Union, Any, Optional, List

from pydantic import BaseModel, EmailStr, Field
from sqlalchemy import BigInteger, Boolean, Column, DateTime, ForeignKey, Integer, \
    String, UniqueConstraint
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from sqlalchemy.schema import Sequence

from app.common.database import Base
from app.models.base import TableBase, TableBase2


class DailyTransReport(TableBase2):
    """订单日报表"""
    __tablename__ = "t_daily_trans_report"
    id = Column(Integer, primary_key=True, index=True, comment='ID')
    trans_date = Column(String(32), unique=True, index=True, comment='报告日期')
    total_num = Column(Integer, nullable=False, comment='总计')
    success_num = Column(Integer, nullable=False, comment='成功数')
    failed_num = Column(Integer, nullable=False, comment='失败数')
    total_amt = Column(Integer, nullable=False, comment='金额总计')
    success_amt = Column(Integer, nullable=False, comment='成功金额')
    total_fee = Column(Integer, nullable=False, comment='费用总计')
    profit_processed_num = Column(Integer, nullable=False, comment='已分润数')


